<!doctype html>
<html>
<head>
<meta charset="utf-8">
<title>只触发一次</title>
<!--引入Vue库-->
<script src="vue.js"></script>
</head>
<body>	
<div id="app">
  <button @click="setVal">普通按钮</button>
  <button @click.once="setVal">触发一次</button>
  <button @click="reset">还原</button>
  <p>单击次数为：{{ result }}</p>
</div>
<script>
  var example = new Vue({
      el: '#app',
      data:{
        result:''
      },
      methods:{
        setVal(event){
          ++this.result
        },
        reset(){
          history.go()
        }
      }
   })
</script>
</body>
</html>
